//
//  CXHeaderView.m
//  ProjectOfBStage
//
//  Created by cuixin on 15/11/13.
//  Copyright © 2015年 cuixin. All rights reserved.
//

#import "CXHeaderView.h"
#define KFont [UIFont systemFontOfSize:13]

@implementation CXHeaderView
-(void)dealloc{
    [_newwButton release];
    [_hotButton release];
    [_label release];
    [super dealloc];
}

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createView];
    }
    return self;
}

-(void)createView{
    self.label = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH_PRO(20), 0, WIDTH_PRO(60), HEIGHT_PRO(30))];
    [self.label setText:@"全部频道"];
    [self.label setFont:KFont];
    [self.label setTextColor:[UIColor blackColor]];
    [self addSubview:self.label];
    
    
    self.hotButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.hotButton.frame = CGRectMake(self.frame.size.width - WIDTH_PRO(80), self.label.frame.origin.y, WIDTH_PRO(40), self.label.frame.size.height);
//    self.hotButton.backgroundColor = [UIColor redColor];
    [self.hotButton setTitle:@"最热" forState:UIControlStateNormal];
    [self.hotButton setTitleColor:[UIColor greenColor] forState:UIControlStateNormal];
    [self.hotButton.titleLabel setFont:KFont];
    [self addSubview:self.hotButton];
    
    
    self.newwButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.newwButton.frame = CGRectMake(self.hotButton.frame.origin.x + self.hotButton.frame.size.width, self.hotButton.frame.origin.y, self.hotButton.frame.size.width, self.hotButton.frame.size.height);
    [self.newwButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [self.newwButton setTitle:@"最新" forState:UIControlStateNormal];
    [self.newwButton.titleLabel setFont:KFont];
    [self addSubview:self.newwButton];

    [_label release];
    
    
    
}
@end
